#!/bin/bash

echo "gateway-biz start..."

#获取pid号
process_id=`ps -ef | grep train-booking-platform-gateway.jar | grep -v grep | awk '{print $2}'`

#如果pid号存在就杀掉进程
if [ ! -z "${process_id}" ];then
  kill -9 $process_id
  echo "process is killed"
fi

#执行jar包,并打印日志输出
nohup java -Dspring.profiles.active=prod -Xmx512m -Xms512m -jar train-booking-platform-gateway.jar > /dev/null 2>&1 &

echo "gateway-biz start success!"